package com.gagakuai.engine.impl.runtime;

import com.gagakuai.engine.impl.delegate.ActivityExecution;
import com.gagakuai.engine.impl.pvm.PvmProcessElement;
import com.gagakuai.engine.impl.pvm.PvmProcessInstance;
import com.gagakuai.engine.impl.pvm.process.ActivityImpl;
import com.gagakuai.engine.impl.pvm.process.ProcessDefinitionImpl;
import com.gagakuai.engine.impl.pvm.runtime.AtomicOperation;
import com.gagakuai.engine.impl.pvm.runtime.StartingExecution;

/*
 * @program: common-starters
 * @description: 可解释执行
 * @author: houhong
 * @create: 2023-01-02 17:13
 */
public interface InterpretableExecution extends ActivityExecution, PvmProcessInstance {

    //// TODO: 2023/1/2
    void setActivity(ActivityImpl activity);

    /*
     * pvm执行调度
     */
    void performOperation(AtomicOperation etomicOperation);

    /*
     * 获取到pvm级别的流程定义实列
     */
    ProcessDefinitionImpl getProcessDefinition();

    /*
     * 获取到流程开始执行器
     */
    StartingExecution getStartingExecution();

    InterpretableExecution getReplacedBy();

    /*
     * 监听器索引
     */
    Integer getExecutionListenerIndex();

    void setExecutionListenerIndex(Integer executionListenerIndex);

    void setEventName(String eventName);

    void setEventSource(PvmProcessElement element);

    boolean shouldExecuteListeners();

    /*
    * 清空
    */
    void disposeStartingExecution();


}